package Manager;


public class ManageConnection {
	
	private static ManageConnection instance = null;
	
	private Database db = null;
	
	private ManageConnection (){
	
		db = new Database("ristorante", "root","admin");
		
		if ( !db.connetti() ) {
		   System.out.println("Errore durante la connessione.");
		   System.out.println( db.getErrore() );
		   System.exit(0);
		}
		
	}
	
	public static ManageConnection getInstance(){
		if (instance == null)
			instance = new ManageConnection();
		return instance;
	}
	
	public Database getConnection(){
		return db;
	}
	
	public void closeConnection(){
		db.disconnetti();
	}
	
	
	
}
